package netTrackerGUI;

/**
 * A thread to handle cell selection that is spawned
 * when a user tries to select a cell. The thread
 * creates a CellOutliner object to handle the selection.
 * 
 * @author David Cummings
 */
public class CellSelectorThread implements Runnable {
	CellSelector myCellSelector;
	
	/**
	 * Constructs a cell selector to move to a cell given a direction to move.
	 * @param trackerPanel The tracker panel creating the thread.
	 * @param selectedCell The cell to move from.
	 * @param moveX the x amount to move. (positive is right)
	 * @param moveY the y amount to move. (positive is down)
	 */
	public CellSelectorThread(TrackerPanel trackerPanel, CellGUI selectedCell, int moveX, int moveY){
		myCellSelector = new CellSelector(trackerPanel, selectedCell, moveX, moveY);
	}
	/**
	 * Constructs a cell selector to try to move to a given cell without a direction.
	 * @param trackerPanel The tracker panel creating the thread.
	 * @param targetCell The cell to move to.
	 */
	public CellSelectorThread(TrackerPanel trackerPanel, CellGUI targetCell){
		myCellSelector = new CellSelector(trackerPanel, targetCell);
	}
	
	public void run() {
		myCellSelector.attemptSelectCell();
	}
}
